<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <form action="" method="POST" id="rowForm">
           <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
             
           		<tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_PLATFORM') ?>:</td>
                    <td>
                    	<select name="row[platform]" id="platform">
                        <?php foreach ($platformlist as $key=>$value) { ?>
                        	<option value="<?=$key ?>" <?php if($key == $row['platform']) echo "selected"; ?> ><?=$value ?></option>
                        <?php } ?>
                      </select>
                    </td>
                </tr>
			                 
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_QUDAO') ?>:</td>
                    <td>
                    	<select name="row[qudao]" id="qudao">
                        <?php foreach ($qudaolist as $key=>$value) { ?>
                        	<option value="<?=$key ?>" <?php if($key == $row['qudao']) echo "selected"; ?> ><?=$value ?></option>
                        <?php } ?>
                      </select>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_AREANUM') ?>:</td>
                  <td>
                      <select name="row[areanum]" id="areanum">
                          <option value="0" <?php if(0 == $row['areanum']) echo "selected"; ?>> all </option>
                        <?php foreach ($areaList as $key=>$value) { ?>
                        	<option value="<?=$key ?>" <?php if($key == $row['areanum']) echo "selected"; ?>><?=$value ?></option>
                        <?php } ?>
                      </select>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_DATABASEIP') ?>:</td>
                    <td><input type="text" name="row[dbip]" id="dbip" size="64" value="<?=$row['dbip'] ?>" /></td>
                </tr>     
                 <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_DBTYPE') ?>:</td>
                    <td>
						<select name="row[dbtype]" id="dbtype">
                        <?php foreach ($dbtypelist as $key=>$value) { ?>
                        	<option value="<?=$key ?>" <?php if($key == $row['dbtype']) echo "selected"; ?>><?=$value ?></option>
                        <?php } ?>
                      </select>
                    </td>
                </tr>
                 <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_DATABASE') ?>:</td>
                    <td><input type="text" name="row[dbname]" id="dbname" size="64" value="<?=$row['dbname'] ?>" /></td>
                </tr>                        
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_USERNAME') ?>:</td>
                    <td><input type="text" name="row[username]" id="username" size="64" value="<?=$row['username'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_PASSWORD') ?>:</td>
                    <td><input type="password" name="row[userpwd]" id="userpwd" size="64" value="<?=$row['userpwd'] ?>" /></td>
                </tr>
                <!--  
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_ZUCONG') ?>:</td>
                  <td>                      
                      <input type="radio" name="row[zucong]" value="1"><?= translate('DATASTATISTICS_DATABASECONTROL_ZU') ?>&nbsp;&nbsp;                    
                      <input type="radio" name="row[zucong]" value="0" checked="checked"><?= translate('DATASTATISTICS_DATABASECONTROL_CONG') ?></td>
                </tr>
                -->
                <tr>
                    <td><?= translate('DATASTATISTICS_DATABASECONTROL_STARTTIME') ?>:</td>
                    <td>
                        <input type="text" name="row[starttime]" id="starttime" value="<?=date('Y-m-d H:i:s',time()) ?>"  
                        	onclick="SelectDate(this,'yyyy-MM-dd hh:mm',0,10)"/>
                    </td>
                </tr>                
                <tr><td></td>
                    <td>
                        <input type="submit" value="<?= translate('SUBMIT') ?>" id="submit"/> <input type="reset" value="<?= translate('RESET') ?>" id="reset"/>
                    </td>
                </tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
              	//$("#platform").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#dbname").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                //$("#dbtype").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                //$("#dbname").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#logname").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#dbip").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#username").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#userpwd").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});  
                //$("#zucong").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#starttime").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'}); 
               });
        </script>
    </body>
</html>